'use strict';
const MANIFEST = 'flutter-app-manifest';
const TEMP = 'flutter-temp-cache';
const CACHE_NAME = 'flutter-app-cache';
const RESOURCES = {
  "version.json": "1947fbfb84026319f6cb7add52fb14fc",
"index.html": "76332722d524d3b1eb84b09ace1f7c9a",
"/": "76332722d524d3b1eb84b09ace1f7c9a",
"main.dart.js": "7de30027b562d10440d2ace7d83351c9",
"favicon.png": "5dcef449791fa27946b3d35ad8803796",
"icons/Icon-192.png": "ac9a721a12bbc803b44f645561ecb1e1",
"icons/Icon-maskable-192.png": "c457ef57daa1d16f64b27b786ec2ea3c",
"icons/Icon-maskable-512.png": "301a7604d45b3e739efc881eb04896ea",
"icons/Icon-512.png": "96e752610906ba2a93c65f8abe1645f1",
"manifest.json": "08bfa9a50909db3b35d506cfade91a31",
"assets/AssetManifest.json": "d7b16f72acc834e664209ea1a539f046",
"assets/NOTICES": "b934ddea45443b3f3e21dbf8838c28ac",
"assets/FontManifest.json": "dc3d03800ccca4601324923c0b1d6d57",
"assets/packages/cupertino_icons/assets/CupertinoIcons.ttf": "6d342eb68f170c97609e9da345464e5e",
"assets/packages/fluttertoast/assets/toastify.js": "e7006a0a033d834ef9414d48db3be6fc",
"assets/packages/fluttertoast/assets/toastify.css": "a85675050054f179444bc5ad70ffc635",
"assets/fonts/MaterialIcons-Regular.otf": "4e6447691c9509f7acdbf8a931a85ca1",
"assets/assets/page_loading.json": "9038b397c2ab77741feaf72ea410bde8",
"assets/assets/images/ad/upload_button.png": "8ba55972b317fb1ba036f7b4f0241763",
"assets/assets/images/ad/mask_black.png": "697d5d2e51f58fee127f4c9b6c1abf3a",
"assets/assets/images/ad/icon_system_reason.png": "9e7c11dc803d52d677a8429e56b0f549",
"assets/assets/images/ad/control_checkbox_nor.png": "5d16249700b4a2b2a05e4f70daf3f282",
"assets/assets/images/ad/icon_detail_pay.png": "ac7f041a82f607a249d17309f5db0c73",
"assets/assets/images/ad/icon_commend_del.png": "42032fa7c479de4d7952908d5ac713d9",
"assets/assets/images/ad/control_checkbox_sel.png": "913dbbc58913289320c13d33eda3d461",
"assets/assets/images/public/icon_system_tips_red.png": "3045dfed362c40c54e9d76f555660835",
"assets/assets/images/public/upload_button.png": "1e8e09e3c73751209bcf782a1fb910be",
"assets/assets/images/public/icon_order_logo.png": "550d76979d6f4a594935d35b712dbafa",
"assets/assets/images/public/add.png": "458c647302076a3870c94e8443eda33f",
"assets/assets/images/public/upload_img_limit3.png": "9bb3d1da6c42c14326baa76f6b120720",
"assets/assets/images/public/defaultpage_noorder.png": "6f3a7a4ad7ce2d6f83b044f7684adcc4",
"assets/assets/images/public/icon_detail_content.png": "8e1abbff9a483cab69a7ef6db9be226a",
"assets/assets/images/public/icon_cancel.png": "d32b56d30ee413bed7edbf2b5ad15fc6",
"assets/assets/images/public/defaultpage_nostore.png": "ffed1f1cfb034a16536666db6a919a0f",
"assets/assets/images/public/control_add.png": "f08e25a4cce0470682d3991afe011723",
"assets/assets/images/public/delete_time_gray.png": "5aaea077acc5e53bf2cf219cfedc5500",
"assets/assets/images/public/icon_mine_account.png": "ba85ab84d1604660b545678e6b050669",
"assets/assets/images/public/icon_system_cancel.png": "ad93ef1c72ea515655e0a18d29e8d0a4",
"assets/assets/images/public/icon_system_arrow_left_b.png": "58617bd9512af7dc09706f2c918ecc68",
"assets/assets/images/public/icon_mine_about.png": "6f16bac7d8f3946900e73f139e063102",
"assets/assets/images/public/control_switch_on_gray.png": "3333654041a6a9f51e5c6664d063b159",
"assets/assets/images/public/icon_home_advertising.png": "431f5cb3eb56c0cc1d728a443a51ab3e",
"assets/assets/images/public/icon_tabar_home_nor.png": "129822d4aa359cef3ade1b8a1f8fa4d8",
"assets/assets/images/public/icon_system_arrow_mid_right.png": "61fd321cfef9c44d3b03c1a9f5810e5f",
"assets/assets/images/public/icon_arrow_mini_down.png": "17bc13f2feebf14c99cc8e0f1e083ea3",
"assets/assets/images/public/card_restaurant.png": "e438223a980296671da64fad570ed3ea",
"assets/assets/images/public/icon_tabar_service_sel.png": "20adf6259a3a8f09ded87f522612eca8",
"assets/assets/images/public/add_time_gray.png": "d81f4a86c62cda62f3093d25e629bf42",
"assets/assets/images/public/control_reduce.png": "23ca3d7b7fef34d30421cfa88be59210",
"assets/assets/images/public/icon_mine_service.png": "e7a50a9d05f580c7834b488c733c2f22",
"assets/assets/images/public/control_switch_on.png": "8015e808d547bb18c63c7cef1631e71f",
"assets/assets/images/public/icon_system_arrow_mini_down.png": "4bab6f8bedc719ab7863f0884477ebd3",
"assets/assets/images/public/bg_shadow.png": "261430ba7c3d910b140b22dd2b470725",
"assets/assets/images/public/icon_system_tips.png": "5c5b0a37af95fc15b5963f9759b22498",
"assets/assets/images/public/icon_system_reason.png": "3cbdb8ffbc08b13c7eb29df44ece4a65",
"assets/assets/images/public/add_time.png": "0555b3b430bcf3fa1c84cb0383dbd3e1",
"assets/assets/images/public/defaultpage_nowifi.png": "f2aa50e118ad8411752bd6c0b9681896",
"assets/assets/images/public/logo_splash.png": "eb495a7f1775c073a0071b0fb12fdda1",
"assets/assets/images/public/icon_system_arrow_mini_right_databoard.png": "212a0d6fc4c1d78b0572ec4c9e31c2cf",
"assets/assets/images/public/picture_failure.png": "547267e485a4a45403e4752a70f26baf",
"assets/assets/images/public/control_checkbox_nor.png": "4f1b7adeb9328c2742ae301ef0e711be",
"assets/assets/images/public/icon_type_.png": "9bc2d99a2c519eb1162771a975b0a4c5",
"assets/assets/images/public/icon_system_arrow_mini_right.png": "b7b3a5743c3798ae51ca832786535547",
"assets/assets/images/public/icon_tabar_service_nor.png": "7818ca6a874473d3b4ff3160cfb20959",
"assets/assets/images/public/icon_limit.png": "a191db046f7debe0f6036da6c0cee3c0",
"assets/assets/images/public/bg_update.png": "543562d9585fcceceea2424b4f4fea6c",
"assets/assets/images/public/delete_time_orange.png": "0cef2179086a0c93179dfe7512e192a9",
"assets/assets/images/public/icon_system_filt.png": "3d6dc0fe64fa6152e2c6754e0f53c6d7",
"assets/assets/images/public/icon_mine_help.png": "0d295bb82666bfc82e62061befa07cb6",
"assets/assets/images/public/upload_image_default.png": "c51dbd4eb0b60f3261ac3f5ce0f7a9ce",
"assets/assets/images/public/icon_plus_gray.png": "43daa7f8790d2c41b2c74a0855f22544",
"assets/assets/images/public/icon_service_change.png": "9f7525170e0ca5fe1f6f06b9e85ea809",
"assets/assets/images/public/logo.png": "b38d0aa7f71b02a12d6ba4bcf23a382f",
"assets/assets/images/public/control_switch_off.png": "d9ecb5e2312fe313bf7f50b0cfb4eb11",
"assets/assets/images/public/tab_title.png": "443620e35b54c37a9132c30c552b55e6",
"assets/assets/images/public/icon_system_arrow_mini_right_gray.png": "1ed18cdb52080eec113a5dcf8f1609a8",
"assets/assets/images/public/icon_mine_base.png": "044b649ab99122d63252fc88fa92beca",
"assets/assets/images/public/icon_system_tips_gray.png": "446fa0c90dbb61805f1d2ef3b12a46bb",
"assets/assets/images/public/icon_arrow_left_b.png": "d1857cd8644c9d2171f3f4d20a083eb7",
"assets/assets/images/public/icon_tabar_home_sel.png": "9bf672abc1161507b926ecee0815a27c",
"assets/assets/images/public/picture_failure_preview.png": "db416605364348a1eea3fef1b30b0afb",
"assets/assets/images/public/icon_system_tips_main.png": "6abcd5dfaf56a6570a3d778c1caf620d",
"assets/assets/images/public/icon_input_del.png": "3c998286e2a012a6e10bb6dc8532f4e9",
"assets/assets/images/public/icon_commend_del_feedback.png": "5b9eeaee87c5c7508775474f99a78fd6",
"assets/assets/images/public/icon_home_dianjin.png": "f3efcf1fca9e6a1674923d859b685fb2",
"assets/assets/images/public/footer_gray.png": "ef3a0ea60c090c109842cdadc4e37e49",
"assets/assets/images/public/home_logo_shadow.png": "06c00d55e621c7af8bf1f8aa752fbdbd",
"assets/assets/images/public/icon_system_gou.png": "8f4a052a20466fe5af633048d1351f52",
"assets/assets/images/public/icon_tab_title.png": "c358433270b271c7618346fbf933e547",
"assets/assets/images/public/control_checkbox_sel.png": "02a6881538d5241a420c3eeac2a0a383",
"assets/assets/images/public/icon_type.png": "b1430b2015aa9d4404aaf7e2eab39073",
"assets/assets/images/public/icon_popup_del.png": "2cd1e049db412182e404aa3546bbc5da",
"assets/assets/top_pull_refresh.json": "753ec4cdcf44534c1d7e1820e097bf1b"
};

// The application shell files that are downloaded before a service worker can
// start.
const CORE = [
  "/",
"main.dart.js",
"index.html",
"assets/NOTICES",
"assets/AssetManifest.json",
"assets/FontManifest.json"];
// During install, the TEMP cache is populated with the application shell files.
self.addEventListener("install", (event) => {
  self.skipWaiting();
  return event.waitUntil(
    caches.open(TEMP).then((cache) => {
      return cache.addAll(
        CORE.map((value) => new Request(value, {'cache': 'reload'})));
    })
  );
});

// During activate, the cache is populated with the temp files downloaded in
// install. If this service worker is upgrading from one with a saved
// MANIFEST, then use this to retain unchanged resource files.
self.addEventListener("activate", function(event) {
  return event.waitUntil(async function() {
    try {
      var contentCache = await caches.open(CACHE_NAME);
      var tempCache = await caches.open(TEMP);
      var manifestCache = await caches.open(MANIFEST);
      var manifest = await manifestCache.match('manifest');
      // When there is no prior manifest, clear the entire cache.
      if (!manifest) {
        await caches.delete(CACHE_NAME);
        contentCache = await caches.open(CACHE_NAME);
        for (var request of await tempCache.keys()) {
          var response = await tempCache.match(request);
          await contentCache.put(request, response);
        }
        await caches.delete(TEMP);
        // Save the manifest to make future upgrades efficient.
        await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
        return;
      }
      var oldManifest = await manifest.json();
      var origin = self.location.origin;
      for (var request of await contentCache.keys()) {
        var key = request.url.substring(origin.length + 1);
        if (key == "") {
          key = "/";
        }
        // If a resource from the old manifest is not in the new cache, or if
        // the MD5 sum has changed, delete it. Otherwise the resource is left
        // in the cache and can be reused by the new service worker.
        if (!RESOURCES[key] || RESOURCES[key] != oldManifest[key]) {
          await contentCache.delete(request);
        }
      }
      // Populate the cache with the app shell TEMP files, potentially overwriting
      // cache files preserved above.
      for (var request of await tempCache.keys()) {
        var response = await tempCache.match(request);
        await contentCache.put(request, response);
      }
      await caches.delete(TEMP);
      // Save the manifest to make future upgrades efficient.
      await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
      return;
    } catch (err) {
      // On an unhandled exception the state of the cache cannot be guaranteed.
      console.error('Failed to upgrade service worker: ' + err);
      await caches.delete(CACHE_NAME);
      await caches.delete(TEMP);
      await caches.delete(MANIFEST);
    }
  }());
});

// The fetch handler redirects requests for RESOURCE files to the service
// worker cache.
self.addEventListener("fetch", (event) => {
  if (event.request.method !== 'GET') {
    return;
  }
  var origin = self.location.origin;
  var key = event.request.url.substring(origin.length + 1);
  // Redirect URLs to the index.html
  if (key.indexOf('?v=') != -1) {
    key = key.split('?v=')[0];
  }
  if (event.request.url == origin || event.request.url.startsWith(origin + '/#') || key == '') {
    key = '/';
  }
  // If the URL is not the RESOURCE list then return to signal that the
  // browser should take over.
  if (!RESOURCES[key]) {
    return;
  }
  // If the URL is the index.html, perform an online-first request.
  if (key == '/') {
    return onlineFirst(event);
  }
  event.respondWith(caches.open(CACHE_NAME)
    .then((cache) =>  {
      return cache.match(event.request).then((response) => {
        // Either respond with the cached resource, or perform a fetch and
        // lazily populate the cache.
        return response || fetch(event.request).then((response) => {
          cache.put(event.request, response.clone());
          return response;
        });
      })
    })
  );
});

self.addEventListener('message', (event) => {
  // SkipWaiting can be used to immediately activate a waiting service worker.
  // This will also require a page refresh triggered by the main worker.
  if (event.data === 'skipWaiting') {
    self.skipWaiting();
    return;
  }
  if (event.data === 'downloadOffline') {
    downloadOffline();
    return;
  }
});

// Download offline will check the RESOURCES for all files not in the cache
// and populate them.
async function downloadOffline() {
  var resources = [];
  var contentCache = await caches.open(CACHE_NAME);
  var currentContent = {};
  for (var request of await contentCache.keys()) {
    var key = request.url.substring(origin.length + 1);
    if (key == "") {
      key = "/";
    }
    currentContent[key] = true;
  }
  for (var resourceKey of Object.keys(RESOURCES)) {
    if (!currentContent[resourceKey]) {
      resources.push(resourceKey);
    }
  }
  return contentCache.addAll(resources);
}

// Attempt to download the resource online before falling back to
// the offline cache.
function onlineFirst(event) {
  return event.respondWith(
    fetch(event.request).then((response) => {
      return caches.open(CACHE_NAME).then((cache) => {
        cache.put(event.request, response.clone());
        return response;
      });
    }).catch((error) => {
      return caches.open(CACHE_NAME).then((cache) => {
        return cache.match(event.request).then((response) => {
          if (response != null) {
            return response;
          }
          throw error;
        });
      });
    })
  );
}
